]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Adapt to dropped X11 backend
authorBilal Elmoussaoui <belmouss@redhat.com>
Tue, 4 Nov 2025 13:08:38 +0000 (14:08 +0100)
committerMarge Bot <marge-bot@gnome.org>
Wed, 5 Nov 2025 11:48:06 +0000 (11:48 +0000)
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3768>

21 files changed:
config.h.meson
data/meson.build
data/org.gnome.Shell@x11.service.in [deleted file]
js/misc/ibusManager.js
js/ui/closeDialog.js
js/ui/keyboard.js
js/ui/layout.js
js/ui/messageTray.js
js/ui/screenShield.js
js/ui/status/remoteAccess.js
js/ui/windowManager.js
man/gnome-shell.rst
meson.build
src/main.c
src/meson.build
src/shell-global.c
src/shell-global.h
src/shell-screenshot.c
src/shell-util.c
src/shell-window-tracker.c
src/st/meson.build

index a357e1c1f74f50092c04d10c3fb53fdf66240a22..b0be35d25e7269fe1324cc4d7e50d7cd7b92475d 100644 (file)
@@ -40,8 +40,5 @@
 /* Define to 1 if the <elf.h> and <link.h> header file exist. */
 #mesondefine HAVE_EXE_INTROSPECTION
 
-/* Whether GNOME Shell is built with X11 support */
-#mesondefine HAVE_X11
-
-/* Whether GNOME Shell is built with X11 clients support */
-#mesondefine HAVE_X11_CLIENT
+/* Whether GNOME Shell is built with XWayland support */
+#mesondefine HAVE_XWAYLAND
index cc7b5e2a1fe6dbc2245ea718d19a62f6a8db43f6..0378910b2fa36bbe6d0cbc3b77451791002ba2f4 100644 (file)
@@ -115,15 +115,6 @@ if have_systemd
   unitconf = configuration_data()
   unitconf.set('bindir', bindir)
   supported_sessions = ['wayland']
-  if have_x11
-    configure_file(
-      input: 'org.gnome.Shell@x11.service.in',
-      output: 'org.gnome.Shell@x11.service',
-      configuration: unitconf,
-      install_dir: systemduserunitdir
-    )
-    supported_sessions += ['x11']
-  endif
 
   configure_file(
     input: 'org.gnome.Shell@wayland.service.in',
diff --git a/data/org.gnome.Shell@x11.service.in b/data/org.gnome.Shell@x11.service.in
deleted file mode 100644 (file)
index 63a014f..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-[Unit]
-Description=GNOME Shell on X11
-# On X11, try to show the GNOME Session Failed screen
-OnFailure=org.gnome.Shell-disable-extensions.service gnome-session-failed.target
-OnFailureJobMode=replace
-CollectMode=inactive-or-failed
-RefuseManualStart=on
-RefuseManualStop=on
-
-After=gnome-session-manager.target
-
-Requisite=gnome-session-initialized.target
-PartOf=gnome-session-initialized.target
-Before=gnome-session-initialized.target
-
-ConditionEnvironment=XDG_SESSION_TYPE=%I
-
-# Limit startup frequency more than the default
-StartLimitIntervalSec=15s
-StartLimitBurst=3
-
-[Service]
-Slice=session.slice
-Type=notify
-ExecStart=@bindir@/gnome-shell
-# Exit code 1 means we are probably *not* dealing with an extension failure
-SuccessExitStatus=1
-
-# On X11 we do not need to unset any variables
-
-# On X11 we want to restart on-success (Alt+F2 + r) and on-failure.
-Restart=always
-# Do not wait before restarting the shell
-RestartSec=0ms
-# Kill any stubborn child processes after this long
-TimeoutStopSec=5
-
-# Lower down gnome-shell's OOM score to avoid being killed by OOM-killer too early
-OOMScoreAdjust=-1000
index 3635fd30ef95182097c196fc876e8f16a0bc4541..0bd282b80c744276715cdd68c71414b0d129f95b 100644 (file)
@@ -1,7 +1,6 @@
 import Gio from 'gi://Gio';
 import GLib from 'gi://GLib';
 import IBus from 'gi://IBus';
-import Meta from 'gi://Meta';
 import Shell from 'gi://Shell';
 
 import * as Signals from './signals.js';
@@ -98,7 +97,7 @@ class IBusManager extends Signals.EventEmitter {
     async _queueSpawn() {
         const isSystemdService = await this._ibusSystemdServiceExists();
         if (!isSystemdService)
-            this._spawn(Meta.is_wayland_compositor() ? [] : ['--xim']);
+            this._spawn([]);
     }
 
     _tryAppendEnv(env, varname) {
index 7e48a3fae4075778c0c7384931d5f33990f13161..85a391ee23806126a42fdbbf3cb46c2a284655c3 100644 (file)
@@ -6,7 +6,6 @@ import Shell from 'gi://Shell';
 import St from 'gi://St';
 
 import * as Dialog from './dialog.js';
-import * as Main from './main.js';
 
 const FROZEN_WINDOW_BRIGHTNESS = -0.3;
 const DIALOG_TRANSITION_TIME = 150;
@@ -22,7 +21,6 @@ export const CloseDialog = GObject.registerClass({
         super._init();
         this._window = window;
         this._dialog = null;
-        this._tracked = undefined;
         this._timeoutId = 0;
     }
 
@@ -111,38 +109,6 @@ export const CloseDialog = GObject.registerClass({
         this.response(Meta.CloseDialogResponse.FORCE_CLOSE);
     }
 
-    _onFocusChanged() {
-        if (Meta.is_wayland_compositor())
-            return;
-
-        const focusWindow = global.display.focus_window;
-        const keyFocus = global.stage.key_focus;
-
-        let shouldTrack;
-        if (focusWindow != null)
-            shouldTrack = focusWindow === this._window;
-        else
-            shouldTrack = keyFocus && this._dialog.contains(keyFocus);
-
-        if (this._tracked === shouldTrack)
-            return;
-
-        if (shouldTrack) {
-            Main.layoutManager.trackChrome(this._dialog,
-                {affectsInputRegion: true});
-        } else {
-            Main.layoutManager.untrackChrome(this._dialog);
-        }
-
-        // The buttons are broken when they aren't added to the input region,
-        // so disable them properly in that case
-        this._dialog.buttonLayout.get_children().forEach(b => {
-            b.reactive = shouldTrack;
-        });
-
-        this._tracked = shouldTrack;
-    }
-
     vfunc_show() {
         if (this._dialog != null)
             return;
@@ -155,12 +121,6 @@ export const CloseDialog = GObject.registerClass({
                 return GLib.SOURCE_CONTINUE;
             });
 
-        global.display.connectObject(
-            'notify::focus-window', this._onFocusChanged.bind(this), this);
-
-        global.stage.connectObject(
-            'notify::key-focus', this._onFocusChanged.bind(this), this);
-
         this._addWindowEffect();
         this._initDialog();
 
@@ -176,7 +136,6 @@ export const CloseDialog = GObject.registerClass({
             scale_y: 1,
             mode: Clutter.AnimationMode.EASE_OUT_BACK,
             duration: DIALOG_TRANSITION_TIME,
-            onComplete: this._onFocusChanged.bind(this),
         });
     }
 
index 06f92513360c63adbd3fbbccfd7770f3af953461..a228db696aa8faf797853258a7d4aac92b131dd4 100644 (file)
@@ -398,16 +398,6 @@ const Key = GObject.registerClass({
             return Clutter.EVENT_STOP;
         });
         button.connect('touch-event', (actor, event) => {
-            // We only handle touch events here on wayland. On X11
-            // we do get emulated pointer events, which already works
-            // for single-touch cases. Besides, the X11 passive touch grab
-            // set up by Mutter will make us see first the touch events
-            // and later the pointer events, so it will look like two
-            // unrelated series of events, we want to avoid double handling
-            // in these cases.
-            if (!Meta.is_wayland_compositor())
-                return Clutter.EVENT_PROPAGATE;
-
             const slot = event.get_event_sequence().get_slot();
 
             if (!this._touchPressSlot &&
@@ -1215,16 +1205,6 @@ export const Keyboard = GObject.registerClass({
         this._windowMovedId = this._focusTracker.connect('window-moved',
             this._onFocusWindowMoving.bind(this));
 
-        // Valid only for X11
-        if (!Meta.is_wayland_compositor()) {
-            this._focusTracker.connectObject('focus-changed', (_tracker, focused) => {
-                if (focused)
-                    this.open(Main.layoutManager.focusIndex);
-                else
-                    this.close();
-            }, this);
-        }
-
         this._showIdleId = 0;
 
         this._keyboardVisible = false;
@@ -1449,11 +1429,10 @@ export const Keyboard = GObject.registerClass({
                 return;
         }
 
-        const emojiVisible = Meta.is_wayland_compositor() &&
-            (purpose === Clutter.InputContentPurpose.NORMAL ||
-             purpose === Clutter.InputContentPurpose.ALPHA ||
-             purpose === Clutter.InputContentPurpose.PASSWORD ||
-             purpose === Clutter.InputContentPurpose.TERMINAL);
+        const emojiVisible = purpose === Clutter.InputContentPurpose.NORMAL ||
+            purpose === Clutter.InputContentPurpose.ALPHA ||
+            purpose === Clutter.InputContentPurpose.PASSWORD ||
+            purpose === Clutter.InputContentPurpose.TERMINAL;
 
         keyboardModel.getLevels().forEach(currentLevel => {
             const levelLayout = new KeyContainer();
@@ -1816,12 +1795,6 @@ export const Keyboard = GObject.registerClass({
         this._keyboardHeightNotifyId = keyboardBox.connect('notify::height', () => {
             this.translation_y = -this.height;
         });
-
-        // Toggle visibility so the keyboardBox can update its chrome region.
-        if (!Meta.is_wayland_compositor()) {
-            keyboardBox.hide();
-            keyboardBox.show();
-        }
     }
 
     _animateHide() {
index 3978bbefe14743ff055eaf5347f45682150065da..fa4c5b0575722ac5fe940391545341befedcfe78 100644 (file)
@@ -184,7 +184,6 @@ class UiActor extends St.Widget {
 const defaultParams = {
     trackFullscreen: false,
     affectsStruts: false,
-    affectsInputRegion: true,
 };
 
 export const LayoutManager = GObject.registerClass({
@@ -846,8 +845,7 @@ export const LayoutManager = GObject.registerClass({
     // @actor: an actor to add to the chrome
     // @params: (optional) additional params
     //
-    // Adds @actor to the chrome, and (unless %affectsInputRegion in
-    // @params is %false) extends the input region to include it.
+    // Adds @actor to the chrome.
     // Changes in @actor's size, position, and visibility will
     // automatically result in appropriate changes to the input
     // region.
@@ -1056,17 +1054,12 @@ export const LayoutManager = GObject.registerClass({
             delete this._updateRegionIdle;
         }
 
-        const rects = [], struts = [];
+        const struts = [];
         const isPopupMenuVisible = global.top_window_group.get_children().some(isPopupMetaWindow);
-        const wantsInputRegion =
-            !this._startingUp &&
-            !isPopupMenuVisible &&
-            Main.modalCount === 0 &&
-            !Meta.is_wayland_compositor();
 
         for (let i = 0; i < this._trackedActors.length; i++) {
             const actorData = this._trackedActors[i];
-            if (!(actorData.affectsInputRegion && wantsInputRegion) && !actorData.affectsStruts)
+            if (!actorData.affectsStruts)
                 continue;
 
             let [x, y] = actorData.actor.get_transformed_position();
@@ -1076,9 +1069,6 @@ export const LayoutManager = GObject.registerClass({
             w = Math.round(w);
             h = Math.round(h);
 
-            if (actorData.affectsInputRegion && wantsInputRegion && actorData.actor.get_paint_visibility())
-                rects.push(new Mtk.Rectangle({x, y, width: w, height: h}));
-
             let monitor = null;
             if (actorData.affectsStruts)
                 monitor = this.findMonitorForActor(actorData.actor);
@@ -1133,9 +1123,6 @@ export const LayoutManager = GObject.registerClass({
             }
         }
 
-        if (wantsInputRegion)
-            global.set_stage_input_region(rects);
-
         this._isPopupWindowVisible = isPopupMenuVisible;
 
         const workspaceManager = global.workspace_manager;
index 86946011c44c363466af9eadec7a88a4326d1026..76c3cf9897e405f182215217f1d5608b53b5d125 100644 (file)
@@ -757,8 +757,8 @@ export const MessageTray = GObject.registerClass({
         this._notificationTimeoutId = 0;
         this._notificationRemoved = false;
 
-        Main.layoutManager.addChrome(this, {affectsInputRegion: false});
-        Main.layoutManager.trackChrome(this._bannerBin, {affectsInputRegion: true});
+        Main.layoutManager.addChrome(this);
+        Main.layoutManager.trackChrome(this._bannerBin);
 
         global.display.connect('in-fullscreen-changed', this._updateState.bind(this));
 
index 706d5a7b45711b630eb4ec2ef20f8b77047849f6..a99bd58b98a611e8592f3d3bf6b79769834f25fc 100644 (file)
@@ -633,11 +633,6 @@ export class ScreenShield extends Signals.EventEmitter {
             animateLockScreen: animate,
             fadeToBlack: true,
         });
-        // On wayland, a crash brings down the entire session, so we don't
-        // need to defend against being restarted unlocked
-        if (!Meta.is_wayland_compositor())
-            global.set_runtime_state(LOCKED_STATE_STR, GLib.Variant.new('b', true));
-
         // We used to set isActive and emit active-changed here,
         // but now we do that from lockScreenShown, which means
         // there is a 0.3 seconds window during which the lock
index 99d7f94838ad4ea5c2f045f5b469802541a8d5cf..7974a1b062fc5e7ad7794a3ad26ef26c0be13a69 100644 (file)
@@ -2,7 +2,6 @@ import Atk from 'gi://Atk';
 import Clutter from 'gi://Clutter';
 import GLib from 'gi://GLib';
 import GObject from 'gi://GObject';
-import Meta from 'gi://Meta';
 import St from 'gi://St';
 
 import * as Main from '../main.js';
@@ -169,13 +168,6 @@ export const ScreenSharingIndicator = GObject.registerClass({
     }
 
     _onNewHandle(handle) {
-        // We can't possibly know about all types of screen sharing on X11, so
-        // showing these controls on X11 might give a false sense of security.
-        // Thus, only enable these controls when using Wayland, where we are
-        // in control of sharing.
-        if (!Meta.is_wayland_compositor())
-            return;
-
         if (handle.isRecording)
             return;
 
index 66bbe66b0c85c6790828abbd5e4edf9c4ca4d677..51eefd298676f85e2a486586aab6cddcdf28ea37 100644 (file)
@@ -897,9 +897,6 @@ export class WindowManager {
             return true;
         });
         global.display.connect('x11-display-closing', () => {
-            if (!Meta.is_wayland_compositor())
-                return;
-
             this._stopX11Services(null);
 
             IBusManager.getIBusManager().restartDaemon();
index d90ea5f6c1b9740428254ad0697e1201dd590453..bd89f9f4f963833bfb81c38b67a3ce378a35b61d 100644 (file)
@@ -35,46 +35,18 @@ OPTIONS
 
   Run as a full display server, rather than nested
 
-``--nested``
-
-  Run as a nested compositor
-
 ``--no-x11``
 
   Run wayland compositor without starting Xwayland
 
-``--x11``
-
-  Run with X11 backend
-
 ``--wayland-display``\ =\ *DISPLAY*
 
   Wayland display name to use
 
-``-d``, ``--display``\ =\ *DISPLAY*
-
-  X display to use
-
 ``-r``, ``--replace``
 
   Replace the running window manager
 
-``--sm-disable``
-
-  Disable connection to the session manager
-
-``--sm-client-id``\ =\ *ID*
-
-  Specify session management *ID*
-
-``--sm-save-file``\ =\ *FILE*
-
-  Initialize session from *FILE*
-
-``--sync``
-
-  Make X calls synchronous
-
 ``--mode=MODE``
 
   Use a specific mode, e.g. "gdm" for login screen
index 0a07efd8a6b130d54b80dcc04678caa049fa52b0..9979e69906da85c4f954dc3475c145e9a28a1d81 100644 (file)
@@ -88,9 +88,8 @@ gnome_desktop_dep = dependency('gnome-desktop-4', version: gnome_desktop_req)
 pango_dep = dependency('pango', version: pango_req)
 
 have_fonts = mutter_dep.get_variable('have_fonts') == 'true'
-have_x11 = mutter_dep.get_variable('have_x11') == 'true'
-have_x11_client = mutter_dep.get_variable('have_x11_client') == 'true'
-if have_x11_client or have_x11
+have_xwayland = mutter_dep.get_variable('have_xwayland') == 'true'
+if have_xwayland
   x11_dep = dependency('x11')
   xext_dep = dependency('xext')
   xfixes_dep = dependency('xfixes')
@@ -157,8 +156,7 @@ cdata.set_quoted('PACKAGE_VERSION', meson.project_version())
 cdata.set('HAVE_NETWORKMANAGER', have_networkmanager)
 cdata.set('HAVE_PIPEWIRE', have_pipewire)
 cdata.set('HAVE_SYSTEMD', have_systemd)
-cdata.set('HAVE_X11', have_x11)
-cdata.set('HAVE_X11_CLIENT', have_x11_client)
+cdata.set('HAVE_XWAYLAND', have_xwayland)
 
 cdata.set('HAVE_FDWALK', cc.has_function('fdwalk'))
 cdata.set('HAVE_MALLINFO', cc.has_function('mallinfo'))
@@ -318,7 +316,7 @@ subdir('js')
 subdir('src')
 subdir('po')
 
-if get_option('tests') and have_x11_client
+if get_option('tests') and have_xwayland
   subdir('tests')
 endif
 
@@ -335,8 +333,7 @@ meson.add_dist_script('build-aux/generate-stylesheets.py')
 meson.add_dist_script('build-aux/check-version.py', meson.project_version(), 'NEWS')
 
 summary_options = {
-  'x11': have_x11,
-  'x11_client': have_x11_client,
+  'have_xwayland': have_xwayland,
   'camera_monitor': get_option('camera_monitor'),
   'networkmanager': get_option('networkmanager'),
   'systemd': get_option('systemd'),
index 99eca3e3c977c882daea66abbff5f4827570aed8..7feef04b7c1a7bf9b1841c7b693ce4637c939462 100644 (file)
@@ -677,8 +677,7 @@ main (int argc, char **argv)
 
   shell_profiler_init ();
 
-  if (meta_context_get_compositor_type (context) == META_COMPOSITOR_TYPE_WAYLAND)
-    meta_context_raise_rlimit_nofile (context, NULL);
+  meta_context_raise_rlimit_nofile (context, NULL);
 
   if (!meta_context_start (context, &error))
     {
index a4ce889eac4f7fecd524e9dc6fa9ca7cb9e150a0..8e45074c5e1168439faee3d7d2cd4edc836c87d1 100644 (file)
@@ -13,7 +13,7 @@ introspection_common = {
 subdir('calendar-server')
 subdir('hotplug-sniffer')
 subdir('st')
-if have_x11_client
+if have_xwayland
   subdir('tray')
 endif
 
@@ -77,7 +77,7 @@ gnome_shell_deps = [
   pango_dep,
 ]
 
-if have_x11_client
+if have_xwayland
   gnome_shell_deps += x11_dep
 endif
 
@@ -132,7 +132,7 @@ libshell_public_headers = [
   'shell-workspace-background.h'
 ]
 
-if have_x11_client
+if have_xwayland
   libshell_public_headers += [
     'shell-tray-icon.h',
     'shell-tray-manager.h',
@@ -152,7 +152,7 @@ libshell_private_headers = [
   'shell-wm-private.h'
 ]
 
-if have_x11_client
+if have_xwayland
   libshell_private_headers += [
     'shell-tray-icon-private.h',
   ]
@@ -189,7 +189,7 @@ libshell_sources = [
   'shell-workspace-background.c'
 ]
 
-if have_x11_client
+if have_xwayland
   libshell_sources += [
     'shell-tray-icon.c',
     'shell-tray-manager.c',
@@ -233,7 +233,7 @@ dbus_generated += gnome.gdbus_codegen('switcheroo-control',
 libshell_no_gir_sources += dbus_generated
 
 libshell_link_with = []
-if have_x11_client
+if have_xwayland
   libshell_link_with += [libtray]
 endif
 
index 9a6de28e98f99d60c043eacd79631e7e2d4f2b42..f4c69e0d3f16b8115b5d4e9262cb037c11922964 100644 (file)
@@ -27,7 +27,7 @@
 #include <meta/meta-workspace-manager.h>
 #include <mtk/mtk.h>
 
-#ifdef HAVE_X11
+#ifdef HAVE_XWAYLAND
 #include <meta/meta-x11-display.h>
 #endif
 
@@ -685,50 +685,6 @@ _shell_global_destroy_gjs_context (ShellGlobal *self)
   g_clear_object (&self->js_context);
 }
 
-/**
- * shell_global_set_stage_input_region:
- * @global: the #ShellGlobal
- * @rectangles: (element-type Mtk.Rectangle): a list of #MtkRectangle
- * describing the input region.
- *
- * Sets the area of the stage that is responsive to mouse clicks when
- * we don't have a modal or grab.
- */
-void
-shell_global_set_stage_input_region (ShellGlobal *global,
-                                     GSList      *rectangles)
-{
-#ifdef HAVE_X11
-  MtkRectangle *rect;
-  XRectangle *rects;
-  int nrects, i;
-  GSList *r;
-  MetaDisplay *display;
-  MetaX11Display *x11_display;
-
-  g_return_if_fail (SHELL_IS_GLOBAL (global));
-
-  if (meta_is_wayland_compositor ())
-    return;
-
-  display = global->meta_display;
-  x11_display = meta_display_get_x11_display (display);
-  nrects = g_slist_length (rectangles);
-  rects = g_new (XRectangle, nrects);
-  for (r = rectangles, i = 0; r; r = r->next, i++)
-    {
-      rect = (MtkRectangle *)r->data;
-      rects[i].x = rect->x;
-      rects[i].y = rect->y;
-      rects[i].width = rect->width;
-      rects[i].height = rect->height;
-    }
-
-  meta_x11_display_set_stage_input_region (x11_display, rects, nrects);
-  g_free (rects);
-#endif
-}
-
 /**
  * shell_global_get_backend:
  *
@@ -1010,7 +966,7 @@ entry_cursor_func (StEntry  *entry,
                            use_ibeam ? META_CURSOR_TEXT : META_CURSOR_DEFAULT);
 }
 
-#ifdef HAVE_X11
+#ifdef HAVE_XWAYLAND
 static void
 on_x11_display_closed (MetaDisplay *display,
                        ShellGlobal *global)
@@ -1027,7 +983,7 @@ _shell_global_set_plugin (ShellGlobal *global,
   MetaDisplay *display;
   MetaBackend *backend;
   MetaSettings *settings;
-#ifdef HAVE_X11
+#ifdef HAVE_XWAYLAND
   MetaX11Display *x11_display;
 #endif
 
@@ -1080,7 +1036,7 @@ _shell_global_set_plugin (ShellGlobal *global,
                                "End of frame, possibly including swap time",
                                "");
 
-#ifdef HAVE_X11
+#ifdef HAVE_XWAYLAND
   x11_display = meta_display_get_x11_display (display);
   if (x11_display && meta_x11_display_get_xdisplay (x11_display))
     g_signal_connect_object (global->meta_display, "x11-display-closing",
index ef07996585177fc461407173a3f2cb14d74413ff..4894d8b4e6f8390bf72fc120a1d18576680b2888 100644 (file)
@@ -46,9 +46,6 @@ void     shell_global_set_force_animations (ShellGlobal *global,
                                             gboolean     force);
 
 /* Input/event handling */
-void     shell_global_set_stage_input_region (ShellGlobal         *global,
-                                              GSList              *rectangles);
-
 void    shell_global_get_pointer             (ShellGlobal         *global,
                                               int                 *x,
                                               int                 *y,
index fc1b2375b49853b1d0c75d36fd0f7f4048c63383..d1ded8c0b9deb9e5390a8d0bae5fd3190821b0e8 100644 (file)
@@ -646,42 +646,6 @@ finish_screenshot (ShellScreenshot  *screenshot,
   return TRUE;
 }
 
-static void
-on_after_paint (ClutterStage     *stage,
-                ClutterStageView *view,
-                ClutterFrame     *frame,
-                GTask            *result)
-{
-  ShellScreenshot *screenshot = g_task_get_task_data (result);
-  MetaDisplay *display = shell_global_get_display (screenshot->global);
-  MetaCompositor *compositor = meta_display_get_compositor (display);
-  GTask *task;
-
-  g_signal_handlers_disconnect_by_func (stage, on_after_paint, result);
-
-  if (screenshot->mode == SHELL_SCREENSHOT_AREA)
-    {
-      do_grab_screenshot (screenshot,
-                          screenshot->screenshot_area.x,
-                          screenshot->screenshot_area.y,
-                          screenshot->screenshot_area.width,
-                          screenshot->screenshot_area.height,
-                          screenshot->flags);
-
-      task = g_task_new (screenshot, NULL, on_screenshot_written, result);
-      g_task_run_in_thread (task, write_screenshot_thread);
-    }
-  else
-    {
-      grab_screenshot (screenshot, screenshot->flags, result);
-    }
-
-  g_signal_emit (screenshot, signals[SCREENSHOT_TAKEN], 0,
-                 (MtkRectangle *) &screenshot->screenshot_area);
-
-  meta_compositor_enable_unredirect (compositor);
-}
-
 /**
  * shell_screenshot_screenshot:
  * @screenshot: the #ShellScreenshot
@@ -731,26 +695,10 @@ shell_screenshot_screenshot (ShellScreenshot     *screenshot,
   if (include_cursor)
     flags |= SHELL_SCREENSHOT_FLAG_INCLUDE_CURSOR;
 
-  if (meta_is_wayland_compositor ())
-    {
-      grab_screenshot (screenshot, flags, result);
+  grab_screenshot (screenshot, flags, result);
 
-      g_signal_emit (screenshot, signals[SCREENSHOT_TAKEN], 0,
-                     (MtkRectangle *) &screenshot->screenshot_area);
-    }
-  else
-    {
-      MetaDisplay *display = shell_global_get_display (screenshot->global);
-      ClutterStage *stage = shell_global_get_stage (screenshot->global);
-      MetaCompositor *compositor = meta_display_get_compositor (display);
-
-      meta_compositor_disable_unredirect (compositor);
-      clutter_actor_queue_redraw (CLUTTER_ACTOR (stage));
-      screenshot->flags = flags;
-      screenshot->mode = SHELL_SCREENSHOT_SCREEN;
-      g_signal_connect (stage, "after-paint",
-                        G_CALLBACK (on_after_paint), result);
-    }
+  g_signal_emit (screenshot, signals[SCREENSHOT_TAKEN], 0,
+                  (MtkRectangle *) &screenshot->screenshot_area);
 }
 
 /**
@@ -780,25 +728,6 @@ shell_screenshot_screenshot_finish (ShellScreenshot  *screenshot,
   return finish_screenshot (screenshot, result, area, error);
 }
 
-static void
-screenshot_stage_to_content_on_after_paint (ClutterStage     *stage,
-                                            ClutterStageView *view,
-                                            ClutterFrame     *frame,
-                                            GTask            *result)
-{
-  ShellScreenshot *screenshot = g_task_get_task_data (result);
-  MetaDisplay *display = shell_global_get_display (screenshot->global);
-  MetaCompositor *compositor = meta_display_get_compositor (display);
-
-  g_signal_handlers_disconnect_by_func (stage,
-                                        screenshot_stage_to_content_on_after_paint,
-                                        result);
-
-  meta_compositor_enable_unredirect (compositor);
-
-  grab_screenshot_content (screenshot, result);
-}
-
 /**
  * shell_screenshot_screenshot_stage_to_content:
  * @screenshot: the #ShellScreenshot
@@ -822,22 +751,7 @@ shell_screenshot_screenshot_stage_to_content (ShellScreenshot     *screenshot,
   g_task_set_source_tag (result, shell_screenshot_screenshot_stage_to_content);
   g_task_set_task_data (result, screenshot, NULL);
 
-  if (meta_is_wayland_compositor ())
-    {
-      grab_screenshot_content (screenshot, result);
-    }
-  else
-    {
-      MetaDisplay *display = shell_global_get_display (screenshot->global);
-      MetaCompositor *compositor = meta_display_get_compositor (display);
-      ClutterStage *stage = shell_global_get_stage (screenshot->global);
-
-      meta_compositor_disable_unredirect (compositor);
-      clutter_actor_queue_redraw (CLUTTER_ACTOR (stage));
-      g_signal_connect (stage, "after-paint",
-                        G_CALLBACK (screenshot_stage_to_content_on_after_paint),
-                        result);
-    }
+  grab_screenshot_content (screenshot, result);
 }
 
 /**
@@ -950,35 +864,18 @@ shell_screenshot_screenshot_area (ShellScreenshot     *screenshot,
   screenshot->screenshot_area.width = width;
   screenshot->screenshot_area.height = height;
 
+  do_grab_screenshot (screenshot,
+                      screenshot->screenshot_area.x,
+                      screenshot->screenshot_area.y,
+                      screenshot->screenshot_area.width,
+                      screenshot->screenshot_area.height,
+                      SHELL_SCREENSHOT_FLAG_NONE);
 
-  if (meta_is_wayland_compositor ())
-    {
-      do_grab_screenshot (screenshot,
-                          screenshot->screenshot_area.x,
-                          screenshot->screenshot_area.y,
-                          screenshot->screenshot_area.width,
-                          screenshot->screenshot_area.height,
-                          SHELL_SCREENSHOT_FLAG_NONE);
-
-      g_signal_emit (screenshot, signals[SCREENSHOT_TAKEN], 0,
-                     (MtkRectangle *) &screenshot->screenshot_area);
-
-      task = g_task_new (screenshot, NULL, on_screenshot_written, result);
-      g_task_run_in_thread (task, write_screenshot_thread);
-    }
-  else
-    {
-      MetaDisplay *display = shell_global_get_display (screenshot->global);
-      MetaCompositor *compositor = meta_display_get_compositor (display);
-      ClutterStage *stage = shell_global_get_stage (screenshot->global);
-
-      meta_compositor_disable_unredirect (compositor);
-      clutter_actor_queue_redraw (CLUTTER_ACTOR (stage));
-      screenshot->flags = SHELL_SCREENSHOT_FLAG_NONE;
-      screenshot->mode = SHELL_SCREENSHOT_AREA;
-      g_signal_connect (stage, "after-paint",
-                        G_CALLBACK (on_after_paint), result);
-    }
+  g_signal_emit (screenshot, signals[SCREENSHOT_TAKEN], 0,
+                  (MtkRectangle *) &screenshot->screenshot_area);
+
+  task = g_task_new (screenshot, NULL, on_screenshot_written, result);
+  g_task_run_in_thread (task, write_screenshot_thread);
 }
 
 /**
index a965c7148acb7084d2ff72a99352a40f4dd45241..da056a01522d66d0199c89895c4ebbcf8c24c52f 100644 (file)
@@ -23,7 +23,7 @@
 #include <gdk-pixbuf/gdk-pixbuf.h>
 #include <meta/meta-context.h>
 #include <meta/display.h>
-#ifdef HAVE_X11_CLIENT
+#ifdef HAVE_XWAYLAND
 #include <meta/meta-x11-display.h>
 #endif
 
@@ -789,7 +789,7 @@ gboolean
 shell_util_has_x11_display_extension (MetaDisplay *display,
                                       const char  *extension)
 {
-#ifdef HAVE_X11_CLIENT
+#ifdef HAVE_XWAYLAND
   MetaX11Display *x11_display;
   Display *xdisplay;
   int op, event, error;
index 839f5244b8dba8f77e7172198893b9ca3d298893..1241764211a197862a8cc96afe33cf426b483567 100644 (file)
@@ -10,7 +10,7 @@
 #include <meta/window.h>
 #include <meta/meta-workspace-manager.h>
 #include <meta/meta-startup-notification.h>
-#ifdef HAVE_X11_CLIENT
+#ifdef HAVE_XWAYLAND
 #include <meta/meta-x11-group.h>
 #endif
 
@@ -302,7 +302,7 @@ static ShellApp*
 get_app_from_window_group (ShellWindowTracker  *tracker,
                            MetaWindow          *window)
 {
-#ifdef HAVE_X11_CLIENT
+#ifdef HAVE_XWAYLAND
   ShellApp *result;
   GSList *group_windows;
   MetaGroup *group;
index 693a143f4f6b8c877766cc778262ec21b37d2f04..772ace8421c8bdf6110d7ba259cd6af5bc05d585 100644 (file)
@@ -213,7 +213,7 @@ libst_dep = declare_dependency(
   include_directories: [st_inc],
 )
 
-if get_option('tests') and have_x11_client
+if get_option('tests') and have_xwayland
   mutter_test_dep = dependency(libmutter_test_pc, version: mutter_req)
   test_theme = executable('test-theme',
     sources: 'test-theme.c',